import styles from './index.less';
import { 
  Table,
} from 'antd';
export default function IndexPage() {
	const sharedOnCell = (_, index) => {
  if (index === 1) {
    return {
      colSpan: 0,
    };
  }
  return {};
};
const columns = [
  {
    title: '汇总',
    colSpan:6,
    dataIndex: 'name1',
    onCell: (_, index) => {
      if(index==0) return {rowSpan: 3}
      if(index==1) return {rowSpan: 0}
      if(index==2) return {rowSpan: 0}
      if(index==3) return {rowSpan: 3}
      if(index==4) return {rowSpan: 0}
      if(index==5) return {rowSpan: 0}
    }
  },
  {
    dataIndex: 'count1',
    onCell: (_, index) => {
      if(index==0) return {rowSpan: 3}
      if(index==1) return {rowSpan: 0}
      if(index==2) return {rowSpan: 0}
      if(index==3) return {rowSpan: 3}
      if(index==4) return {rowSpan: 0}
      if(index==5) return {rowSpan: 0}
    }
  },
  {
    dataIndex: 'name2',
    onCell: (_, index) => {
      if(index==0) return {rowSpan: 2}
      if(index==1) return {rowSpan: 0}
      if(index==2) return {rowSpan: 1}
      if(index==3) return {rowSpan: 2}
      if(index==4) return {rowSpan: 0}
      if(index==5) return {rowSpan: 1}
    }
  },
  {
    dataIndex: 'count2',
    onCell: (_, index) => {
      if(index==0) return {rowSpan: 2}
      if(index==1) return {rowSpan: 0}
      if(index==2) return {rowSpan: 1}
      if(index==3) return {rowSpan: 2}
      if(index==4) return {rowSpan: 0}
      if(index==5) return {rowSpan: 1}
    }
  },
  {
    dataIndex: 'name3',
  },
  {
    dataIndex: 'count3',
  },
];
const data = [
  {
    key: '1',
    name1: '累计签约客户',
    name2:'长期协议客户',
    name3:'中资客户',
    count1: 100,
    count2: 20,
    count3: 5,
  },
  {
    key: '2',
    name1: '累计签约客户',
    name2:'长期协议客户',
    name3:'外资资客户',
    count1: 100,
    count2: 20,
    count3: 15,
  },
  {
    key: '3',
    name1: '累计签约客户',
    name2:'简版协议客户',
    name3:'',
    count1: 100,
    count2: 80,
    // count3: 0,
  },

  {
    key: '4',
    name1: '单月新增客户',
    name2:'长期协议客户',
    name3:'中资客户',
    count1: 500,
    count2: 200,
    count3: 150,
  },
  {
    key: '5',
    name1: '单月新增客户',
    name2:'长期协议客户',
    name3:'外资资客户',
    count1: 500,
    count2: 200,
    count3: 50,
  },
  {
    key: '6',
    name1: '单月新增客户',
    name2:'简版协议客户',
    name3:'',
    count1: 500,
    count2: 300,
    // count3: 0,
  },
];
  return (
    <><Table columns={columns} dataSource={data} bordered /></>
  );
}
